//
// IGraphicLibrary.hh for nibbler in /home/lefebv_w//workspace/cpp/nibbler/v2/lib
// 
// Made by damien lefebvre
// Login   <lefebv_w@epitech.net>
// 
// Started on  Fri Mar  8 12:43:54 2013 damien lefebvre
// Last update Sun Mar 24 18:06:01 2013 damien lefebvre
//

#ifndef		__IGRAPHICLIBRARY_HH__
#define		__IGRAPHICLIBRARY_HH__

#include	<string>
#include	<vector>

class		IGraphicLibrary
{
public :
  #define	DEFAULT_WINDOWS_NAME		"-- Nibbler by moreau_r, lefebv_w & gomes_m --" 
#define		SIZE_CASE		16

  enum		e_TypeOfCase
    {
      EMPTY, WALL, SNAKE, BONUS, SNAKEHEAD
    };

  enum		e_ListOfImage
    {
      IMG_EMPTY_1, IMG_EMPTY_2, IMG_EMPTY_3, IMG_EMPTY_4, IMG_WALL, IMG_SNAKE_PART1, IMG_SNAKE_PART2, IMG_BONUSPART, IMG_SNAKEHEAD, IMG_SNAKEFOOT, IMG_BONUS5PART_1, IMG_BONUS5PART_2, IMG_BONUSLIFE, IMG_42
    };
  
  enum		e_TypeOfEvent
    {
      KB_UP, KB_LEFT, KB_DOWN, KB_RIGHT, PAUSE, EXIT, NONE
    };

  enum		e_Direction
    {
      UP, LEFT, DOWN, RIGHT
    };

  class		InfoPicture
  {
  private :
    std::string		m_path;
    e_ListOfImage	m_type;
    char		m_char;

  public :
    InfoPicture(std::string const & path, char c, e_ListOfImage type)
      : m_path(path), m_type(type), m_char(c)
    {}

    std::string	const &	getPath(void) const
    {
      return (m_path);
    }

    e_ListOfImage	getType(void) const
    {
      return (m_type);
    }

    char		getChar(void) const
    {
      return (m_char);
    }
  };

public :
  // Constructor 
  //virtual GraphicLibrary(unsigned int const size_x, unsigned int const size_y, std::vector<InfoPicture> const & listOfPictures) = 0;

  // refresh the screen 
  virtual void	refreshScreen(void) = 0;
  
  // draw an element on the screen
  virtual void	draw(unsigned int x, unsigned int y, e_ListOfImage const e, e_Direction const dir = UP) = 0;

  // return the first event
  virtual e_TypeOfEvent		checkEvent(void) = 0;

  /* draw the footer */
  virtual void	draw_footer(unsigned int x, unsigned int y, std::string const & str) = 0; 
};

typedef		IGraphicLibrary	*(*maker_IGraphicLibrary)(unsigned int size_x, unsigned int size_y, std::vector<IGraphicLibrary::InfoPicture> const & listOfPictures);

extern "C"
{
  IGraphicLibrary	*make_IGraphicLibrary(unsigned int size_x, unsigned int size_y, std::vector<IGraphicLibrary::InfoPicture> const & list);
}

#endif
